UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L1ii++OFF1eBMJLMEspjc6gDoei5UX/3nGD0HVkugZg='
WHERE
key_id = 'be282d98c088faa29f90b43095868a930261c909713055e131744db60d48d8dc'
AND (
token = 'L1ii++OFF1eBMJLMEspjc6gDoei5UX/3nGD0HVkugZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)