UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FJNpKmpRz1x7Dl0jO5pIHF3u0j9Lq5HkUackd1I/hcU='
WHERE
key_id = '6fd05a3dcba622eede1f247604d37f41bf8c9d94841fb6f4276aed248525a5fb'
AND (
token = 'FJNpKmpRz1x7Dl0jO5pIHF3u0j9Lq5HkUackd1I/hcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)