UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yAWK1zxCpuVJfbtX+//0m1pE41NTDSOCvRxpZ0QKxs0='
WHERE
key_id = '6dee7b297beba4f8ef746fef0e9b25139725acb059b5d517cfc62913a3e4fa88'
AND (
token = 'yAWK1zxCpuVJfbtX+//0m1pE41NTDSOCvRxpZ0QKxs0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)