UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Czva7UI2UX4rD0IFh3E/vpfbZm4yqNdgTgdYaTa4phc='
WHERE
key_id = '5ff04aef3326b13529865718494cd3b31828cca0cf0081bd63ce497629b64d8c'
AND (
token = 'Czva7UI2UX4rD0IFh3E/vpfbZm4yqNdgTgdYaTa4phc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)