UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GGlynQZqEYwjc7iwAmMlUVvNQUcHAJcEDzJNvK4sCo0=' 
WHERE 
  key_id = 'ef5527c75dd4a88da0f2734f298b177d2dc6204df72c5e2327b85ea82c9d501c' 
  AND (
    token = 'GGlynQZqEYwjc7iwAmMlUVvNQUcHAJcEDzJNvK4sCo0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019