UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H2sM2nXxjFigfWPJxVAG5vW9IAvHgPaUtLmBECAkvPg='
WHERE
key_id = '89125ab817bd680aa4fe4129b7e8e222a01d3b0a57894c0f894b3ae27fb88489'
AND (
token = 'H2sM2nXxjFigfWPJxVAG5vW9IAvHgPaUtLmBECAkvPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)