UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C3Bx7iEA5vWXAFXp3+iX6S2+V+mAEnlqlgFGO7Cvyho=' 
WHERE 
  key_id = '1659aa3a008bd2456843c8dd0f1a2dd6c487cd195c31bea242d2dfd8e4aee5fd' 
  AND (
    token = 'C3Bx7iEA5vWXAFXp3+iX6S2+V+mAEnlqlgFGO7Cvyho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038