UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HAcm6d9XN1T5eyhokCGuOJA/kUhjCRNhxODdE1F3KCk='
WHERE
key_id = '0279ad03c5eeb4d912635adc99e8bd37d9402bfff437ad4d68706adce6bba94a'
AND (
token = 'HAcm6d9XN1T5eyhokCGuOJA/kUhjCRNhxODdE1F3KCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)