UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IdPPjyj+8OmIqpGHZhHEvKBWWR+qfg9UkyP5eTWTD7U='
WHERE
key_id = 'f035c2a0696e8d5c3dec58ba08278907cad9df5c7d3c19b607e9bfa59b68a764'
AND (
token = 'IdPPjyj+8OmIqpGHZhHEvKBWWR+qfg9UkyP5eTWTD7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)