UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PCYfVQvMjfcxeRPG3uPbKNWopV7m7Hw9EJri2pMcanc='
WHERE
key_id = 'eb2ecab8f52334fa616dc6e93d39ab54f51b5914e4907530b00aad280e730cb4'
AND (
token = 'PCYfVQvMjfcxeRPG3uPbKNWopV7m7Hw9EJri2pMcanc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)