UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PpGRHePaNKqsm2PsWfZXatS3fguBdCu4hlRKCJuHS/o='
WHERE
key_id = '764fec5ee58281c0a58933efb534a43e2cd9d8524a14f77b703b58b0e701b588'
AND (
token = 'PpGRHePaNKqsm2PsWfZXatS3fguBdCu4hlRKCJuHS/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)