UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DWyu0wHVW4JQqOzlPSYkiJFGXVQhtE5dLiG90uKnQoI=' 
WHERE 
  key_id = '99e260ce2bddf968fdd21701af14afdfdc51abe1939e9dccf5f5e647044ac374' 
  AND (
    token = 'DWyu0wHVW4JQqOzlPSYkiJFGXVQhtE5dLiG90uKnQoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019