UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4JY5h6vXzIhG6lVxlP5ibjsRt387W4p3IsoLsOR6b4o=' 
WHERE 
  key_id = 'cd864e1740165063c298967fc2c8d4795c5fd36f074e6c86a78d18d6d0f1f381' 
  AND (
    token = '4JY5h6vXzIhG6lVxlP5ibjsRt387W4p3IsoLsOR6b4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030