UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FhZgrDr0t+R0hGduduaZTRyEsQ05oZ6He4sP4tyCXxg=' 
WHERE 
  key_id = '4206b0057685226250b382f152d2da4153e2df3a18bce9f6e6f62fc0af6b88e4' 
  AND (
    token = 'FhZgrDr0t+R0hGduduaZTRyEsQ05oZ6He4sP4tyCXxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030