UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lXlqHxa9WznooGqF7N6DELEH5re7Vd3DIuf3PLnL6Kg='
WHERE
key_id = '3c1a98e423ea592de29655b3ea44f50e10811a17e5fe4cae977c3f88e60e472d'
AND (
token = 'lXlqHxa9WznooGqF7N6DELEH5re7Vd3DIuf3PLnL6Kg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)