UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z7NIBgnglPNPQcGTaiSU7OWVbNxKANxSYHgKrL0kxfI='
WHERE
key_id = 'eb69d921248fd2c36b6366647e4b3d584124866ac00fce86cffc182040abf633'
AND (
token = 'Z7NIBgnglPNPQcGTaiSU7OWVbNxKANxSYHgKrL0kxfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)