UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T30Mp/ZHxga7j78GSw9M5NFL5nw9LgAqBLPB0+eEQVE='
WHERE
key_id = 'defaa0ee16570e6c6d8bd47dc20dc9632d810e7acd0533d3e6635f27f039936c'
AND (
token = 'T30Mp/ZHxga7j78GSw9M5NFL5nw9LgAqBLPB0+eEQVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)