UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'arWJiC9Ckaj+ZUbr8MN+5OUeUWA57Eotgxy91LQswmo=' 
WHERE 
  key_id = '6621539a1cffef50c3c2d41fd78ee67f9916a46e8dcaa4eef8f57bce9caf54d3' 
  AND (
    token = 'arWJiC9Ckaj+ZUbr8MN+5OUeUWA57Eotgxy91LQswmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030