UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F1KUefkxk7l9lR51MfJ5RAV6mbpVLOqaKNMf0T3wCkc='
WHERE
key_id = '0e302cc86470bd0a99d4be39909f46c0a913b9bdadb842beb4f6d9f1c7192c75'
AND (
token = 'F1KUefkxk7l9lR51MfJ5RAV6mbpVLOqaKNMf0T3wCkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)