UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Cf0Kl2nscK/dHazWlvZ2XblihRO3Rev2HMEXnEOlnA='
WHERE
key_id = 'b984d4427359ea93da239db04a6a757699efcc3115612eea8cde4176a07cb1a3'
AND (
token = '6Cf0Kl2nscK/dHazWlvZ2XblihRO3Rev2HMEXnEOlnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)