UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j3/VHfMu+rHR6u0CTmJuQO9Ki3DRu7vfJVQoLPKakjk=' 
WHERE 
  key_id = 'd58bbc4c2d6d1ab6ea6122879ab7197716aa2d87dd5f55f3314478988286a91c' 
  AND (
    token = 'j3/VHfMu+rHR6u0CTmJuQO9Ki3DRu7vfJVQoLPKakjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017