UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j/y+gItKaiWMAsZFkNZBxRyU5v+phpO7XAS6mZ8bxQM='
WHERE
key_id = 'c21716e282fc6bef0ed727de46806655b0ebf8fdc7c2dd635bd3531f5fe77c60'
AND (
token = 'j/y+gItKaiWMAsZFkNZBxRyU5v+phpO7XAS6mZ8bxQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)