UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ReVLvDUFId6GbzBIrCNtT2BYHhpl9GuthTRCI08Zp/c='
WHERE
key_id = 'c2c6fafd60062c68a4998e5a8c559351015cb448c61c1bd635a9a0f5956b6653'
AND (
token = 'ReVLvDUFId6GbzBIrCNtT2BYHhpl9GuthTRCI08Zp/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)