UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fAag9JNBOD0E5z1jhTsP60u5RTtpyltr/VA4BcPXpwU='
WHERE
key_id = '2f8eb129cebfdcf62b8327c7ae6d618aa84b6e731a10d8c5685898799eb498e5'
AND (
token = 'fAag9JNBOD0E5z1jhTsP60u5RTtpyltr/VA4BcPXpwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)