UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dem+vWaFjb5QVGn2p5Hp96lf9cRJI5qpY3i9x89fKpU=' 
WHERE 
  key_id = '8fb224d6cf815f4e5c4cd5c455811e74201d84d2d57b6e66e9a6466aeef37de1' 
  AND (
    token = 'Dem+vWaFjb5QVGn2p5Hp96lf9cRJI5qpY3i9x89fKpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033