UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qEYyma6u224hcj24XMyzPJKzpgs5T8Kl9hyIhmem4+A='
WHERE
key_id = '2b1a5918ff4c7c4e8436e7337fba9408e73ec254f391125191936093e7a7db88'
AND (
token = 'qEYyma6u224hcj24XMyzPJKzpgs5T8Kl9hyIhmem4+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)