UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XRHnLwp+5YdzFVNgmctPAnVdZ9bhqJ0ha97OFHT7Cs8='
WHERE
key_id = '444c4bb76b837ff4c140d5e5f86ac513e5efaae704bef33b94c036779441b5fc'
AND (
token = 'XRHnLwp+5YdzFVNgmctPAnVdZ9bhqJ0ha97OFHT7Cs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)