UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZyIkKkbwObWtfzetZR2oXYi/jaA6HEOd6wS+gp5uGT4=' 
WHERE 
  key_id = 'd72a62a2410b02ec6c6740ecf41957f0e380f2d5fe84f5e91b61ebf6a3324b34' 
  AND (
    token = 'ZyIkKkbwObWtfzetZR2oXYi/jaA6HEOd6wS+gp5uGT4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032