UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uhw7OkbvIqLfYGwFC/kiUrhNbXiSxl5hJ68jMYNNTMQ='
WHERE
key_id = '3aeaf63b4e44c3a939c8f090544e5ac5e0b1a842f135519ae53d6f47bfa52a70'
AND (
token = 'uhw7OkbvIqLfYGwFC/kiUrhNbXiSxl5hJ68jMYNNTMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)