UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5rtCiP4yAqkbr8HXZyYuO+Aw5S0LUzaNX+rqo7b7vIU=' 
WHERE 
  key_id = '7b0de8c75d78cc57f49d669de44554ca2b5bdebf4252e23f8bf8f75a4301fd65' 
  AND (
    token = '5rtCiP4yAqkbr8HXZyYuO+Aw5S0LUzaNX+rqo7b7vIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028