UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pV0nXwkA97a8+JhfRlUP5gbFMweP6G+5ZS3XDiXQaAY='
WHERE
key_id = 'a1cff533517e7b7fa93f7f80802248182019a56bdf24c14c47505fc84c37429b'
AND (
token = 'pV0nXwkA97a8+JhfRlUP5gbFMweP6G+5ZS3XDiXQaAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)